import {Util} from "../../util/Util";
import {ISkill} from "../ISkill";

export abstract class Skill implements ISkill{
    //标识
    id: number;
    //上次使用时间
    lastUsedTime: number;
    //cd
    cd: number[];
    //技能等级
    level: number;

    duration: number;

    constructor(data:{
        id: number,
        lastUsedTime: number,
        level: number,
        cd: string,
        duration?: number,

        damageBase?: string,
        description: string,
        hpCost?: string,
        iconIndex: number,
        iconPath: string,
        mpCost?: string,
        name: string,
        ratio: number,
        targetGroup: string,
        targetSelect: string,
        type: string,
        version: number,
        propertyString?: string,
        propertyValue?: number,
        hitMoment?: number,
        effect1?: string,
    }){
        this.id = data.id;
        this.lastUsedTime = data.lastUsedTime;
        this.level = data.level;
        this.duration = data.duration;
        this.cd =  Util._stringToArrayByComma(data.cd);
    }

    canCast(): boolean {
        return false;
    }

    cast(caster: any,target: any): void {
    }

}
